<?php echo $this->Session->flash(); ?>
<table id="tabla" class="tabla" width="100%">
    <thead>
        <tr>
            <th>Username</th>
            <th>Nombre</th>
            <th>Primer apellido</th>
            <th colspan="3"></th>
        </tr>
    </thead>
    <tbody>
        <?php foreach ($User as $usuario): ?>
            <tr>
                <td><?php echo $usuario['User']['username'] ?> </td>
                <td><?php echo $usuario['User']['nombre'] ?></td>
                <td><?php echo $usuario['User']['primer_apellido'] ?></td>
                <td><?php echo $ajax->link("Proyectos asignados", array('controller' => "UserProyects", "action" => "index", $usuario['User']['id']), array('update' => 'content', 'complete' => 'cargar()', 'indicator' => 'loading')) ?></td>
                <td><?php echo $ajax->link("editar", array('controller' => "Users", "action" => "edit", $usuario['User']['id']), array('update' => 'content', 'indicator' => 'loading')) ?></td>
                <td><?php echo $ajax->link($html->image("delete.png", array('width' => '30', 'heigth' => '30', 'alt' => 'Adicionar usuario')), array('controller' => "Users", "action" => "delete", $usuario['User']['id']), array('update' => 'content', 'complete' => 'cargar()', 'indicator' => 'loading', 'escape' => false), '¿Esta seguro de eliminar el usuario? ') ?></td>
            </tr>
        <?php endforeach; ?>
    </tbody>
</table>
<?php echo "<br>"; ?>
<?php echo $ajax->link($html->image("user_add.png", array('width' => '30', 'heigth' => '30', 'alt' => 'Adicionar usuario')), array('controller' => 'Users', 'action' => 'add_users'), array('update' => 'content', 'complete' => 'cargar()', 'indicator' => 'loading', 'escape' => false)); ?>